<!--
  ~ This program is part of the OpenLMIS logistics management information system platform software.
  ~ Copyright © 2013 VillageReach
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  ~  
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
  ~ You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org. 
  -->

<h2 id="managePodHeader" openlmis-message="header.pod.manage"></h2>

<div class="app-form">

  <div class="row-fluid">
    <div>
      <div class="form-cell">
        <label openlmis-message="label.program"></label>

        <div class="form-field">
          <select ui-select2 class="span3"
                  id="programListMyFacility"
                  ng-model="filter.program" ng-change="onParamChanged()">
            <option value="{{program.id}}" ng-repeat="program in programs">{{program.name}}</option>
          </select>
        </div>
      </div>
    </div>
    <div class="span5" ng-show="filter.program">
      <div class="form-cell">
        <div class="form-field checkbox">
          <input id="allpods" type="checkbox" ng-change="onParamChanged()" ng-model="option.all">
          <label for="allpods" class="checkbox">
            Show all pending PODs under this program
          </label>
        </div>

      </div>

    </div>
  </div>
  <div ng-show="filter.program && !option.all">
    <div class="row-fluid">
      <div class="form-cell">
        <label openlmis-message="label.facility"></label>

        <div class="form-field">
          <select ui-select2
                  id="facility" class="span3"
                  ng-model="filter.facility" ng-change="onFacilityChanged()">
            <option value="{{facility.id}}" ng-repeat="facility in facilities">{{facility.name}}</option>
          </select>
        </div>
      </div>
    </div>
  </div>


  <div class="form-group" ng-show="(filter.program && option.all) || filter.facility">
    <h3 openlmis-message="label.order.list"></h3>

    <div class="alert alert-info" id="noOrdersPresent" ng-hide="orders && orders.length">
      <span openlmis-message="message.no.order"></span>
    </div>


    <div class="form-row clearfix"></div>
    <div ng-show="orders && orders.length" class="gridStyle" ng-grid="gridOptions"></div>
  </div>
</div>
